package com.lxg.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ElementController implements WebMvcConfigurer {

    //添加拦截器组件
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册拦截器，及拦截请求和要剔除哪些请求!
        // 我们还需要过滤静态资源文件，否则样式显示不出来
        registry.addInterceptor(new InterceptorConfig()).addPathPatterns("/admin/**");
//                .addPathPatterns("/**")
//                .excludePathPatterns("/index.html","/first/login.html","/","/css/*","/img/**",
//                        "/js/**","/error.html","/user/**");
    }

}
